package cn.schoolwow.quickdao.module.database.ddl.action.flow.column;

import cn.schoolwow.quickdao.domain.entity.PropertyOption;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import org.apache.commons.lang3.Validate;

public class CheckPropertyOptionFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        PropertyOption propertyOption = (PropertyOption) flowContext.checkData("propertyOption");

        Validate.notNull(propertyOption.column, "字段列名称不能为空");
        Validate.notNull(propertyOption.columnType, "字段列类型不能为空");
    }

    @Override
    public String name() {
        return "检查新增数据库字段参数";
    }
}
